Skip to content

[WIP] Tree Wasserstein distances and Sliced Tree Wasserstein#821

Draft
Flastre wants to merge 14 commits into
PythonOT:masterfrom
Flastre:tree
Draft

[WIP] Tree Wasserstein distances and Sliced Tree Wasserstein#821
Flastre wants to merge 14 commits into
PythonOT:masterfrom
Flastre:tree

Conversation

@Flastre

@Flastre Flastre commented Jun 19, 2026

Copy link
Copy Markdown

Wasserstein distances on trees.

In ot/lp/solver_tree.py : the function tree_wasserstein return the distance and the transport plan between two distributions on a tree
In ot/lp/tree_barycenter : the function tree_barycenter returns the barycenter between multiples distributions on a tree

I plan on adding a sliced version of the tree wasserstein distance, and maybe some functions to generate trees (as explained in the first article)

References :

Tree-Sliced Variants of Wasserstein Distances
Tree-Wasserstein Barycenter for Large-Scale Multilevel Clustering and Scalable Bayes

@github-actions github-actions Bot added the ot.lp label Jun 19, 2026
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.17964% with 150 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.27%. Comparing base (f1e0c5c) to head (aadd8b1).

❌ Your patch check has failed because the patch coverage (10.17%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #821      +/-   ##
==========================================
- Coverage   96.83%   96.27%   -0.57%     
==========================================
  Files         128      130       +2     
  Lines       25376    25543     +167     
==========================================
+ Hits        24574    24591      +17     
- Misses        802      952     +150     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Boudjema Ali and others added 7 commits June 30, 2026 15:14
* correction SGOT cost matrix, added to contributor list, move sgot example to other

* updated graphs

* fix plots

* update example

* fix releases.md

* reformating

* updating format

* updated format

* updated format

* added PR and references

* aligned usage of solve and solve_batch + added batch tests

* fixed example

* Apply suggestions from code review

Co-authored-by: Rémi Flamary <remi.flamary@gmail.com>

---------

Co-authored-by: Sienna O'Shea <osheasienna@gmail.com>
Co-authored-by: Rémi Flamary <remi.flamary@gmail.com>
…ythonOT#833)

* fix label-aware cost correction in ot.da

the cost correction that pushes apart differently-labeled samples was
computed backwards. it used missing_ys = (ys == -1) and the product of
the two missing masks, so the large cost was applied only where both
labels are missing, and never where two labeled samples have different
labels. with all labels known the correction was a no-op, so ys/yt had
no effect on the transport (see PythonOT#664).

switched to present masks (ys != -1) so the correction applies exactly
to labeled source/target pairs whose labels differ, matching the
original pre-vectorized loop. restored the semisupervised tests that had
been flipped to assert the buggy no-op (n_unsup == n_semisup) back to
asserting the cost actually changes, and added a regression test.

closes PythonOT#664

* add PR number to releases entry

* Apply suggestion from @rflamary

* use MISSING_LABEL constant instead of bare -1

---------

Co-authored-by: Rémi Flamary <remi.flamary@gmail.com>
* nx version + update actions

* add run on arm

* use slim ubuntu

* back to linux latest

* reamp all tests

* fix yaml

* fix yaml

* fix yaml

* try it

* validate yaml

* speeup backen tests

* remove doctest for beckend tests

* remove cleanup space

* separate doctests

* fix cdoctest with proper cnftest

* fix helpers

* fix linux-torch test

* remove torch version

* fix doc build

* fix doc build

* fix doctests

* move stuff around properly

* gix doctest for the last time?

* stuff

* change version

* pdate reelase + readme

* update cff + readme

* big rewrite release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants